package com.hyh.prize.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hyh.prize.mapper.TabSaleplanGiftlogMapper;
import com.hyh.prize.service.TabSaleplanGiftlogService;
import com.lww.springcloudapi.entity.TabSaleplanGiftlog;
import com.lww.springcloudapi.result.Result;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 营销礼品异动表 服务实现类
 * </p>
 *
 * @author SHEN
 * @since 2021-03-11
 */
@Service
public class TabSaleplanGiftlogServiceImpl extends ServiceImpl<TabSaleplanGiftlogMapper, TabSaleplanGiftlog> implements TabSaleplanGiftlogService {

    @Override
    public Result getList(long current, long limit, TabSaleplanGiftlog tabSaleplanGiftlog) {
        Page<TabSaleplanGiftlog> page=new Page(current,limit);
        QueryWrapper<TabSaleplanGiftlog> queryWrapper=new QueryWrapper<>();
        if(tabSaleplanGiftlog.getAreaid()!=null){
            queryWrapper.eq("ACPTSITEID",tabSaleplanGiftlog.getAreaid());
        }

        Page<TabSaleplanGiftlog> tabSaleplanGiftlogPage = this.page(page, queryWrapper);
        return Result.ok(tabSaleplanGiftlogPage);
    }
}
